home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / mus / play / multiplsr.lha / Bovs / Bovs.doc < prev    next >
Text File  |  1992-04-10  |  30KB  |  554 lines

  1.                                    Bovs
  2.                                 Version 2.0
  3.                         Bryan's Overlay Supervisor
  4.                          Copyright 1992 Bryan Ford
  5.  
  6.  
  7.                                 Disclaimer
  8.                                 ~~~~~~~~~~
  9.  
  10.     This program is provided "as is" without warranty of any kind, either
  11. expressed or implied, including, but not limited to, the implied warranty
  12. of fitness for a particular purpose.  The entire risk as to the results,
  13. reliability and performance of this program is assumed by you.
  14.  
  15.  
  16.  
  17.                                Distribution
  18.                                ~~~~~~~~~~~~
  19.  
  20.     Bovs may be freely distributed as long as it is complete (none of the
  21. files listed below are left out), all of the files are unmodified, and no
  22. charge is made for such distribution other than a small fee to cover the
  23. cost of copying.  (In effect, no profit may be made through distribution of
  24. this program).  You may modify this code for your own personal use, but you
  25. may not distribute modified versions.  (If you improve Bovs, send your
  26. modifications back to me and I'll incorporate them into the master, giving
  27. credit to you of course.  This way we won't have hundreds of different
  28. versions of Bovs floating around.)
  29.  
  30.     You may use the object code derived from this source code, or your own
  31. modified version of this source code, in your own public domain, freeware,
  32. shareware, or otherwise freely distributable programs, as long as you
  33. visibly state that you used Bovs and mention the name of its author (Bryan
  34. Ford) somewhere in your documentation.  You do not need to obtain any kind
  35. of license or special permission to use it in freely distributable software.
  36.  
  37.     If you want to distribute Bovs or any modified version of it, in either
  38. source or object form, with a commercial package, you must send me a copy
  39. of that commercial package as soon as it is released, as well as any major
  40. updates to the program released in the future.  (This only applies for as
  41. long as the program uses Bovs.)  Other than that, there is no cost for
  42. using Bovs in a commercial program.
  43.  
  44.     The Bovs distribution must contain the following files, complete and
  45. unmodified:
  46.  
  47.         Bovs.doc        Bovs documentation (this file)
  48.         Bovs.o          Linkable version of Bovs (assembled with OVERLAY=1)
  49.         Bst.o           Same, without overlay support (assembled with OVERLAY=0)
  50.         Bovs.h          Header file for SAS/C programs
  51.         Bovs.asm        Source code for Bovs (A68k)
  52.  
  53.         MemMan/MemMan.doc       MemMan documentation
  54.         MemMan/memman.library   MemMan runtime library
  55.         MemMan/MemMan.o         Linkable version of MemMan
  56.         MemMan/MemMan.fd        Entrypoints for memman.library
  57.         MemMan/MemMan.h         Header for C programs using MemMan
  58.         MemMan/MemMan.i         Same, for assembly language
  59.         MemMan/MemMan.asm       Source to MemMan (A68k)
  60.         MemMan/MemManLib.asm    Source to memman.library interface (A68k)
  61.         MemMan/Macros.i         Macros you'll need for the above two files
  62.         MemMan/LMKfile          SAS/C makefile for MemMan
  63.         MemMan/test             Program to test memman.library
  64.         MemMan/test.c           Source for MemMan test program
  65.  
  66.  
  67.  
  68.                                Introduction
  69.                                ~~~~~~~~~~~~
  70.  
  71.     Bovs (pronounced "boffs") is an overlay system designed to replace the
  72. standard overlay system supplied with SAS/C.  It acts as both overlay
  73. supervisor and startup code.  It provides many powerful features that the
  74. standard SAS/C startup code and overlay supervisor don't provide.  It is
  75. intended especially for large and medium-size applications which need
  76. flexible and efficient use of memory.  It is used in my Shareware music
  77. player, MultiPlayer.  For smaller programs, there is an alternative form of
  78. Bovs without the overlay system, but with all of Bovs's other features.
  79.  
  80.     Bovs currently requires SAS/C's linker, BLink (or a very compatible
  81. linker, if there is such), to create overlaid files.  However, other than
  82. that, SAS/C is not necessarily needed: you can write programs that use Bovs
  83. in assembly language or any other language that supports register arguments
  84. and the standard Amiga object file format.
  85.  
  86.     Programs that use Bovs can be started from Workbench or the CLI.  Both
  87. 1.3 and 2.0 are supported, but when run under 2.0 Bovs supports automatic
  88. command-line parsing with ReadArgs().  If started from the CLI, Bovs
  89. detaches and runs your program in a separate process, freeing up the
  90. original CLI.
  91.  
  92.     Instead of the standard, rigidly-structured, hierarchially-organized
  93. overlay system that standard Amiga overlay systems use, Bovs uses a very
  94. flexible overlay method based on dynamic memory caching.  When overlaid
  95. code is called, the overlay node in which it is contained is loaded in if
  96. necessary, and the function is called.  However, overlay nodes are not
  97. flushed from memory when other overlay nodes at the same level are called.
  98. (In fact, Bovs doesn't even use overlay "levels".)  Instead, they remain in
  99. memory and immediately available until the memory they occupy is needed for
  100. something else.
  101.  
  102.     This is where MemMan comes in.  The Bovs distribution includes MemMan,
  103. a low-memory manager also written by myself, which allows programs to be
  104. called when any call to AllocMem() is about to fail, so they can free
  105. memory they don't need.  (Note that while Bovs currently only supports the
  106. BLink that comes with SAS/C, MemMan can be used by many compilers.  See
  107. MemMan's documentation for details.)  Bovs uses MemMan to unload overlay
  108. nodes that aren't currently in use when the system is about to run out of
  109. memory.  Your program can also use MemMan alongside Bovs.
  110.  
  111.     If the user of a Bovs program has lots of memory, Bovs ends up acting
  112. as a "delayed-loading" system, to speed up initial loading and load other
  113. parts of the program only when necessary.  After all parts of the program
  114. are loaded, if the user never runs out of memory, no more loading is done
  115. and calls to overlaid functions are instantaneous.  However, if the user
  116. does run out of memory, Bovs can immediately free inactive overlay nodes,
  117. which gives the system some extra "padding" and helps prevent
  118. memory-shortage problems.
  119.  
  120.     To keep track of which overlay nodes are in use and which may be freed
  121. on demand, Bovs uses a system of nestable locks associated with each
  122. overlay node.  When an overlaid function is called, locking is handled
  123. automatically: Bovs locks the overlay node before calling the function,
  124. and unlocks it after the function returns.  However, your program may also
  125. specifically lock and unlock overlay nodes to ensure that they remain in
  126. memory at certain times.
  127.  
  128.  
  129.  
  130.                                Startup Code
  131.                                ~~~~~~~~~~~~
  132.  
  133.     Before getting into Bovs's overlay management, I'll describe how Bovs
  134. handles startup and exit.  First of all, Bovs may not be used along with
  135. "c.o" or any of the other standard startup code files.  Bovs does not
  136. support SAS's standard C-style memory allocation or file handling
  137. functions, or any other non-trivial standard library functions.  (You can
  138. still use string functions and such.)  Bovs is, therefore, "Amiga-only."
  139.  
  140.     Bovs supports auto-detaching.  When your program is run from the CLI, a
  141. separate process is started for your program and the original CLI is given
  142. back to the user.  Unlike typical auto-detaching startup code, however,
  143. Bovs lets the program decide whether or not to detach before actually
  144. splitting off into a separate process.  For example, MultiPlayer (which
  145. uses Bovs) provides a "NODETACH" command-line switch which will cause it to
  146. keep running in the normal CLI.  If for some reason you don't even want the
  147. option to detach, you can reassemble Bovs or Bst with the DETACH flag set
  148. to 0.
  149.  
  150.     Somewhere in the non-overlaid part of your program (probably your main
  151. module), you'll have to define several variables containing various pieces
  152. of information Bovs needs during startup.  I'll give the C definitions for
  153. these variables; for assembly language, just add an underscore ('_') before
  154. the variable names.
  155.  
  156.     First, you need to define a longword variable called "stack" which
  157. contains the stack size required for your program.  Note that this value is
  158. only used if the program was loaded from the CLI and thus was detached from
  159. the original CLI process.  If you want a larger-than-normal stack, make
  160. sure you set this variable AND the stack size specified in the Workbench
  161. icon for your program.
  162.  
  163.     Second, you must define a pointer variable called "progname" which is a
  164. pointer to a string containing the name for the process created when
  165. auto-detaching from the CLI.  This string is also used as the program name
  166. when Bovs encounters a serious error and must display a message and
  167. terminate before ever calling your program.  Like the "stack" variable,
  168. this is not used when the program is run from Workbench.
  169.  
  170.     Third, you need to define a longword variable called "priority" which
  171. contains the Exec priority level at which your program is to run.  Unlike
  172. the above variables, this is used when your program is started from either
  173. the Workbench or the CLI.  This priority will be in effect through both
  174. PreStart() and Main().  If run from the CLI without detaching, Bovs will
  175. automatically switch back to the CLI's original priority before exiting.
  176.  
  177.     Finally, you must define three variables which Bovs passes to AmigaDOS
  178. 2.0's ReadArgs() function if your program is run under 2.0.  The variable
  179. "argtemplate" must be a pointer to a string containing the standard
  180. argument template.  For example, part of MultiPlayer's template is
  181. "DIRECTORY,PLAY=MODULES/M,PROG=PROGRAM/K".  The variable "argarray" must be
  182. an array of longwords (it's often convenient to define it as a structure in
  183. C) which AmigaDOS 2.0 will fill in with the parameters from the parsed
  184. argument template.  The variable "argexthelp" must contain a pointer to an
  185. extended help string which will be displayed to the user as a prompt if '?'
  186. is entered as an argument on the command line.  (If this pointer is NULL,
  187. the argtemplate will be used for this purpose.)  I won't go into the
  188. details of argument parsing; Commodore's documentation should suffice.
  189.  
  190.     In addition to these six variables, you must define two functions in
  191. your main program.  First, the PreStart() function ("@PreStart" in assembly
  192. language) must be defined like this:
  193.  
  194.     void __regargs PreStart(int arglen,char *argstr)
  195.                                   D0           A0
  196.  
  197.     (You may omit the "__regargs" keyword if you are compiling with
  198. register arguments as the default.)  This function will always be called
  199. before Main().  If your program was run from the CLI, PreStart() will be
  200. called before detaching, while Main() will be called after detaching.  At
  201. this point, all other variables have been set up and the command line has
  202. been parsed (if your program was run under 2.0).  You may call BExit() and
  203. BRExit() from this routine; if you do this, and your program was called
  204. from the CLI, you will never detach from the original CLI.  Otherwise, if
  205. you return from this function normally, Bovs will detach if necessary and
  206. then call Main().
  207.  
  208.     Take MultiPlayer as an example of the use of PreStart().  It contains a
  209. "NODETACH/K" entry in its argument template.  MultiPlayer's PreStart()
  210. function checks for this switch, and if the user specified it on the
  211. command line, PreStart() simply calls Main() immediately, and when it
  212. returns, it calls BExit() or BRExit().  Note that if Bovs calls PreStart(),
  213. unless you call BExit() or BRExit() from within that function, Bovs will
  214. AlWAYS also call Main() at a later point, even if it runs into a fatal
  215. error between the two calls.  If it can't detach for some reason, it simply
  216. remains attached and calls Main() directly.  That way, you can set things
  217. up (allocate memory, etc.) in PreStart() without having to worry that
  218. Main() will never get called for some reason.
  219.  
  220.     The Main() function ("@Main" in assembly language) is the normal
  221. entrypoint of your program.  It must be defined like this:
  222.  
  223.     void __regargs Main(int arglen,char *argstr)
  224.                               D0           A0
  225.  
  226.     When either PreStart() or Main() is called, "arglen" contains the
  227. length of the unparsed command line received directly from AmigaDOS, and
  228. "argstr" is a pointer to that command line.  (Bovs doesn't separate the
  229. command line into separate arguments like the standard startup code does;
  230. the name change from "main" to "Main" is intended to emphasize this
  231. difference.)  If your program is called from the Workbench, "arglen" will
  232. contain zero and "argstr" will contain the Workbench startup message.
  233.  
  234.     Note that the raw command line is available on entry even if the
  235. command line was also parsed with 2.0's ReadArgs() function.  Under 1.3,
  236. your "argarray" variable will remain unmodified and unused; under 2.0,
  237. you'll get both the parsed and the unparsed arguments.  Bovs defines the
  238. long integer symbol "argsparsed" ("_argsparsed" in assembly language),
  239. which it sets to nonzero if the arguments were successfully parsed with
  240. 2.0's ReadArgs().  If you want compatibility with both 1.3 and 2.0, you
  241. should use the parameters in "argargarray" if "argsparsed" is nonzero;
  242. otherwise parse the raw command line yourself.
  243.  
  244.     When Main() is called, you don't have any standard input or output
  245. streams, so don't be printing error messages to nonexistant file handles.
  246. (You may use standard I/O from PreStart() if your program was called from
  247. the CLI.)  However, your current directory will be whatever the current
  248. directory was in the CLI your program started from, or if you started from
  249. Workbench, the directory containing your program icon.  You don't have to
  250. return to this directory before exiting your program, although you must not
  251. UnLock() it (Bovs will do that if necessary).
  252.  
  253.     When the Main() function returns, Bovs frees all resources, closes the
  254. executable file if it was using overlays, and ends the program with a
  255. return code of zero.  You can also do this from anywhere in your program
  256. (as long as you're running from the original process Bovs started you in)
  257. by calling BExit() or BRExit(), described later.  Remember, Bovs provides
  258. NO resource tracking like standard C startup code does: you must free
  259. anything you allocate.  (Of course, Bovs will free anything it allocates.)
  260.  
  261.  
  262.  
  263.                                  Overlays
  264.                                  ~~~~~~~~
  265.  
  266.     First of all, be warned that the use of Bovs overlays is not completely
  267. transparent.  Even if you're already using overlays in your program,
  268. converting it to use Bovs will require a little work.  How much it requires
  269. depends on your program.  In this document, I'll assume that you are trying
  270. to convert a non-overlaid program into an overlaid program that uses Bovs.
  271. If you have already written an overlaid program, you shouldn't have too
  272. much trouble figuring out what you need to change.
  273.  
  274.     Your program will have to have at least one non-overlaid object file,
  275. as well as one or more overlaid files.  You don't have to work out any
  276. complicated overlay call tree or anything: all the overlay nodes are on the
  277. same overlay "level", and any combination of them may be loaded at one
  278. time.  Overlay nodes may even call other overlay nodes, although you will
  279. have to fudge a little to get around some of BLink's error checking.
  280.  
  281.     You'll have to set up a WITH file that you pass to BLink to link your
  282. program.  In it, along with whatever other BLink options you want, supply
  283. an OVERLAY construct that looks something like this:
  284.  
  285. OVERLAY
  286. window.o windowspec.o
  287. progwin.o progwinspec.o
  288. prefswin.o prefswinspec.o
  289. flashy.o flash.o flashyspec.o
  290. rexx.o
  291. #
  292.  
  293.     (This is part of MultiPlayer's WITH file.)  All the object files on one
  294. line are linked into the same overlay node: they are loaded and unloaded
  295. together, and they may share data, make no-overhead calls to each other,
  296. and so on.  Each line specifies a separate overlay node.  Note that you
  297. should never use asterisks ('*') before the filenames, which normally
  298. denote overlay sublevels, as Bovs neither needs nor supports hierarchial
  299. overlays.
  300.  
  301.     There are certain limitations to what you can do when programming with
  302. overlays.  First, you can't directly reference data in one overlay node
  303. from another overlay node, or from the root.  The only exception to this
  304. is if you name the overlay node's data hunks "__MERGED", in which case
  305. BLink will merge the data into the root node's global data segment.  In
  306. effect, the data is no longer associated with the overlay node it was
  307. defined in, but rather in the permanently resident root node.  Compiling
  308. with SAS/C using the small data model will cause this to happen.  You
  309. should avoid putting too much overlay-node-specific data into the __MERGED
  310. hunk, because that data will be loaded all the time the program runs, even
  311. when the actual overlay node isn't loaded.  (To keep certain variables out
  312. of the __MERGED hunk under SAS/C while still using the small data model,
  313. just define your overlay-node-private variables as __far.)
  314.  
  315.     Bovs imposes very few restrictions on calling functions in overlay
  316. nodes.  Any time an overlaid function is called, BLink reroutes the call
  317. through an entrypoint in Bovs, which loads the required overlay node if it
  318. isn't already loaded, locks it in memory, calls the function, and unlocks
  319. it when the function returns.  Theoretically, functions within overlay
  320. nodes could call functions in other overlay nodes with no problem.
  321. However, BLink has some very inconvenient error checking code that won't
  322. let you link a program in which one overlay node calls another.  (This is
  323. based on the assumption that loading one overlay node causes all other
  324. overlay nodes on the same level to be unloaded - which, with Bovs, is not
  325. the case.)  For now, unless you find a way to hack BLink to disable this
  326. code (if you do, tell me how!), you'll have to create "stub" functions in
  327. some non-overlaid module to bounce calls back into other overlay nodes.
  328.  
  329.     Function calling conventions in Bovs are quite different from those
  330. used with the standard overlay manager.  In particular, no stack parameters
  331. are allowed when calling an overlaid function from outside the function's
  332. overlay node (when BLink has to route the function through Bovs).  This is
  333. because Bovs has to keep some information on the stack during the call so
  334. it can unlock the overlay node on returning.  (It can't just "load and
  335. jump" like the standard overlay supervisor can.)  The only parameters that
  336. are guaranteed to get to the called function are register parameters passed
  337. in A0 and A1.  (In SAS/C, with register arguments active, this amounts to
  338. two pointer-type parameters; if you want to pass value parameters, just
  339. convert them them to void pointers.)  In addition, the register A4 is
  340. passed through to allow easy use of the small data model.
  341.  
  342.     If you pass register parameters to overlay functions when using Bovs,
  343. you'll get a bunch of annoying but meaningless warning messages from BLink
  344. telling you that the register parameters will get destroyed, because it
  345. thinks that overlay functions are supposed to be called with stack
  346. parameters.  For now, just let the warnings roll up your screen; I'm trying
  347. to get SAS to put an option in BLink to disable this checking, but so far
  348. I've had no luck.
  349.  
  350.     Now we get into the really unconventional bit.  When an overlaid Bovs
  351. function is called, it actually receives one extra parameter that the
  352. caller never passed to it.  This parameter is passed in D0 (just define it
  353. as a 'long' in a SAS/C function prototype), and contains a "handle" on the
  354. overlay node in which the function resides.  This handle is only valid
  355. throughout that function call, unless the function locks the overlay node
  356. into memory with LockOverlay(), described later, before returning.  A valid
  357. handle passed to you will never be zero (unless you are using "Bst" instead
  358. of "Bovs" and thus have overlays disabled - this is described later), but
  359. other than that you can't assume anything about what it actually is.
  360.  
  361.     At this point, you should be able to implement overlaid programs using
  362. Bovs.  Bovs also has some extra features to make your programs sleek and
  363. efficient, which are described in the following sections.
  364.  
  365.  
  366.  
  367.                                  Functions
  368.                                  ~~~~~~~~~
  369.  
  370.     Bovs defines a few extra functions which you may call during your
  371. program for various purposes.  Besides these, since MemMan must also be
  372. linked into any program that uses Bovs, you may also call MemMan's memory
  373. management functions.  Do not call MMInit() or MMFinish() from your program
  374. - Bovs does that for you.  However, if you use MemMan directly, you must be
  375. sure to remove all MMNodes before terminating your program.  (See
  376. MemMan.doc for details on using MemMan.)
  377.  
  378.  
  379.     void BExit(void)
  380.     void BRExit(long retcode,long retcode2)
  381.                        D0            D1
  382.  
  383.     Call one of these functions to terminate your program.  BExit() returns
  384. with a returncode of zero; BRExit() allows you to set the return codes
  385. before exiting.  "retcode" should be RETURN_OK, RETURN_WARN, RETURN_ERROR,
  386. or RETURN_FAIL (defined in dos/dos.h). if you are returning an error,
  387. "retcode2" should contain the secondary return code - one of the ERROR_xxx
  388. definitions in dos/dos.h.  Note that these return codes will normally be
  389. "seen" only if you call BRExit() from within your PreStart() routine.  If
  390. you call it from Main(), your program will have already been detached and
  391. no one will be paying attention to whatever return code you terminate with.
  392. (Of course, if you have reassembled Bovs with the DETACH flag set to zero,
  393. then the return code will always be seen by the CLI.) Calling BExit() is
  394. effectively the same as returning from your Main() function.
  395.  
  396.     Of course, since Bovs does no resource tracking, you must be sure to
  397. free all resources before calling BExit() or BRExit().  Also, they may only
  398. be called from the original process that Bovs gave you.
  399.  
  400.  
  401.     void LockOverlay(long ovhan)
  402.                            D0
  403.     void UnlockOverlay(long ovhan)
  404.                               D0
  405.  
  406.     Given an overlay handle passed by Bovs to one of your overlaid
  407. functions, LockOverlay() will lock the overlay node containing that
  408. function in memory.  It will not be unloaded until you unlock the overlay
  409. node.  LockOverlay() calls may be nested, and every call to LockOverlay()
  410. must be paired with exactly one call to UnlockOverlay().  The only
  411. exception to this rule is that you don't have to unlock every locked
  412. overlay node before your program exits: Bovs will unload all loaded overlay
  413. nodes before exiting, locked or unlocked.  In any case, you must never try
  414. to unlock an overlay node that you haven't already locked.
  415.  
  416.     You may only call LockOverlay() on a given overlay handle from within
  417. the function that was passed the handle, or from within a sub-function that
  418. it calls.  You MAY NOT pass an overlay handle back from an overlay function
  419. to the function that calls it, unless you lock it first.  In other words,
  420. the overlay handle is only valid during the call to the overlaid function,
  421. unless you lock it within that function.
  422.  
  423.     When using LockOverlay() and UnlockOverlay() to ensure that a certain
  424. overlay node stays in memory at certain times, it is permissible for the
  425. main module or other overlay nodes to access the overlay node's data
  426. (indirectly through pointers, since direct references are not allowed), or
  427. to call functions in the overlay node through function pointers.  This can
  428. be desirable, for example, if you have some function that is very
  429. frequently called and you don't want the slight extra overhead of running
  430. through the overlay supervisor every time the function is called.  However,
  431. any time "outsiders" access a node's data or functions this way, you must
  432. be sure that the overlay node is always locked at the time, so it can't
  433. disappear on you.
  434.  
  435.     You may call UnlockOverlay() from anywhere in your program, as long as
  436. you are sure the overlay handle you're passing to it is valid and locked,
  437. and you're sure that the call will not pull out the carpet from under you
  438. in some way.  To put it in simpler terms, an overlay node may be unlocked
  439. by (a) an "outsider" who has been given the overlay handle to unlock, or
  440. (b) a function within the overlay node which was called normally through
  441. the overlay supervisor (not directly through a function pointer).  Since
  442. functions called through function pointers are not automatically locked by
  443. Bovs throughout the call, if such a function were to unlock the last lock
  444. on its own overlay node, it could be unloaded while the function is still
  445. running.  The only time when you may unlock the last lock on an overlay
  446. node from within such a function is in assembly language: if the call to
  447. UnlockOverlay() is done with a JMP instruction, and the return address
  448. points to some other overlay node (or the root), the call to
  449. UnlockOverlay() will return directly to whatever "outsider" called the
  450. function in the first place, so there is no problem.
  451.  
  452.     If this all sounds a little complicated at this point, don't panic: you
  453. only need to worry about this if you're using function pointers called by
  454. external modules.  If you stick to normal functions, there is not much you
  455. need to worry about.
  456.  
  457.  
  458.     long ResCall(void *routine,void *arg1,void *arg2)
  459.      D0                   A2          A0         A1
  460.  
  461.     This function is a little gimmick that you might find useful for
  462. creating sleek, fast programs.  It is used to call overlaid functions in a
  463. way slightly different than normal.  If some part of the program wants to
  464. call a function in another overlay node, normally it makes a call normally,
  465. and BLink reroutes the call to go through Bovs.  However, instead of
  466. calling the function directly, you can pass a pointer to it (which BLink
  467. turns into a pointer to one of its dynamically created rerouter routines)
  468. to ResCall, along with the parameters "arg1" and "arg2" which you would
  469. normally pass to the real function in A0 and A1.  ResCall then calls the
  470. function normally, with the parameters that you specify.
  471.  
  472.     If the overlay node containing the needed function is already loaded,
  473. then the function is called normally, and its return value (whatever it may
  474. be) is passed back in D0, as usual.  However, if the overlaid function is
  475. NOT resident, the function is not called at all, and Bovs returns with zero
  476. in D0 immediately, without loading the overlay node.
  477.  
  478.     Thus, ResCall provides a simple and convenient way to call an overlaid
  479. function only if that overlay node is already resident.  I have found this
  480. useful in many cases, but I'll let you figure them out yourself.  In any
  481. case, if the overlay node is resident and the function is called, all
  482. standard overlay function calling and locking conventions still apply.
  483.  
  484.  
  485.  
  486.                                    Bst.o
  487.                                    ~~~~~
  488.  
  489.     The alternate object file "Bst.o" (pronounced "beast") can be used in
  490. place of "Bovs.o" if you want Bovs's startup features without its overlay
  491. system, or if you want to create a non-overlaid version of a program that
  492. is normally overlaid.  Your normally overlaid functions may end up be
  493. called with anything (including zero) as the overlay handle parameter in
  494. D0, since they are not called through the overlay supervisor at all.  While
  495. the LockOverlay() and UnlockOverlay() functions still exist in Bst, they do
  496. absolutely nothing.  Therefore, as long as you're somewhat careful, you
  497. should be able to link your program in both overlaid and non-overlaid
  498. versions, and have it perform exactly the same either way.  MultiPlayer's
  499. registered distribution, for example, contains both overlaid and
  500. non-overlaid versions of the MultiPlayer program, to best suit the user's
  501. preferences.
  502.  
  503.  
  504.  
  505.                                   History
  506.                                   ~~~~~~~
  507.  
  508. 2.0 (10-Apr-92)
  509.         Removed the commercial license fee.  (All I require now for commercial use is a copy
  510.             of the commercial program when it is completed.)
  511.         Added PreStart call to allow program to avoid auto-detachment.
  512.         Added conditional assembly to allow Bovs to be assembled without auto-detach capability.
  513.         Changed 'argtemplate' to be a _pointer_ to a string, not an actual string.
  514.         Argument parsing on 2.0 now allows a client-defined extended help string ('argexthelp').
  515.         Renamed 'procname' to 'progname'.
  516.         Fixed a bug in setting priority when starting from Workbench.
  517.         Added 'argsparsed' flag which is set if the arguments were parsed with 2.0's ReadArgs().
  518.         Fixed a memory deallocation bug that could cause problems with programs linked in a
  519.             certain (unusual) way.
  520.  
  521. 1.0 (18-Feb-92)
  522.         First public release.
  523.  
  524.  
  525.  
  526.                               Contact Address
  527.                               ~~~~~~~~~~~~~~~
  528.  
  529.     I tend to move around a great deal, so mail sent directly to me
  530. sometimes has a hard time catching up.  If you want mail to reach me (it
  531. may take a while, but it WILL reach me), send it to this address:
  532.  
  533.         Bryan Ford
  534.         8749 Alta Hills Circle
  535.         Sandy, UT 84093
  536.  
  537.     I can be reached more quickly (for the time being anyway) on the phone
  538. or through one of the electronic mail addresses below:
  539.  
  540.         (801) 585-4619
  541.         bryan.ford@m.cc.utah.edu
  542.         baf0863@cc.utah.edu
  543.         baf0863@utahcca.bitnet
  544.  
  545.     If you want to get something to me through the mail more quickly, FIRST
  546. call or E-mail me to make sure I'm still here, then send it to this address:
  547.  
  548.         Bryan Ford
  549.         27104 Ballif Hall
  550.         University of Utah
  551.         Salt Lake City, UT 84112
  552.  
  553.     Enjoy!
  554.